package com.handinglian.ai.notice.mapper;

import com.handinglian.ai.notice.dto.*;import com.handinglian.ai.notice.entity.Notice;
import java.util.Collection;import java.util.Date;import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface NoticeMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Notice record);

    int insertOrUpdate(Notice record);

    int insertOrUpdateSelective(Notice record);

    int insertSelective(Notice record);

    Notice selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Notice record);

    int updateByPrimaryKey(Notice record);

    int updateBatch(List<Notice> list);

    int batchInsert(@Param("list") List<Notice> list);

    List<NoticeDto> list(@Param("titleOrTemplate") String titleOrTemplate, @Param("type") Integer type, @Param("categorys") List<Integer> categorys, @Param("methods") List<Integer> methods, @Param("sortField") String sortField, @Param("sortOrder") String sortOrder);

    int deleteByIdIn(@Param("idCollection") Collection<Integer> idCollection);

    List<Notice> findByTitleLike(@Param("likeTitle") String likeTitle);

    List<NoticeTemplateDto> findNoticeTemplateByIdIn(@Param("idCollection") Collection<Integer> idCollection);

    int updateActualTimeByIdIn(@Param("updatedActualTime") Date updatedActualTime, @Param("idCollection") Collection<Integer> idCollection);

    NoticeKeyDto getNoticeKey(@Param("id") Integer id, @Param("key") String key);

    List<NoticeDetailDto> listDetail(@Param("id") Integer id, @Param("nameOrPhoneOrAddress") String nameOrPhoneOrAddress, @Param("key") String key,  @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("phoneStatuses") List<Integer> phoneStatuses, @Param("notExecute") Integer notExecute, @Param("sortField") String sortField, @Param("sortOrder") String sortOrder);

    List<NoticeKeyDto> listNoticeKey(@Param("id") Integer id);

    Integer countCallTemplate(@Param("templateId")Integer templateId);

    Integer countMessageTemplate(@Param("templateId")Integer templateId);

    Integer countByType(@Param("type")Integer type);
}